import { createApp } from 'vue'
import App from './App.vue'
// import { store } from './store'
import axios from 'axios'  //如果需要axios，请引入
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import "@/assets/theme.less";
import "@/assets/global.css";
// import Ellipsis from '@/views/common/Ellipsis'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

// 新增：引入 vue-router
import { createRouter, createWebHashHistory } from 'vue-router';

import Lottery from "./views/Lottery.vue";
import Set from "./views/Set.vue";

const routes = [
  {
    path: '/',
    redirect: '/lottery' ///定义默认页面
   // redirect: '/login'
  },
  {
    path: '/lottery',
    component: Lottery,
    meta: { title: '幸运抽奖' }
  },
  {
    path: '/set',
    component: Set,
    meta: { title: '幸运抽奖' }
  }
];
const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

const app = createApp(App)
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}

app.use(ElementPlus);
app.use(router);
// app.use(Ellipsis);
// store(app)
window.axios = axios
app.mount('#app')
